
import seaborn as sns
pal = sns.color_palette("colorblind")


# Subsectors shortnames for graph legend
dict_subsector_shortnames_uppercase = {'Batteries': 'Bat',
                'Fuel Cells': 'FC',
                'Hybrid Vehicles': 'HV',
                'Electric Vehicles': 'EV',
                'Hydrogen': 'H2',
                'Energy Storage': 'Stor',
                'Biofuels': 'Biofuels',
                'Enabling Technologies': 'Enab',
                'Car Efficiency': 'EffCar',
                'ICE Efficiency': 'EffICE',
                'Internal Combustion Engine': 'ICE',
                'Mitigation Air': 'Air',
                'Mitigation Maritime': 'Maritime',
                'Mitigation Rail': 'Rail',
                'Mitigation Road': 'Road',
                'Mitigation Other': 'Other',
                'Elec Efficiency': 'EffElec',
                'Agriculture': 'Agri',
                'Biomass and Waste': 'BioWas',
                'Carbon Capture and Storage': 'CCS',
                'Chemical': 'Chem',
                'Building Efficiency': 'EffBuild',
                'Final Goods': 'Goods',
                'Hydrofracturing': 'Fracking',
                'Industry Sector-wide': 'Industry',
                'Metal': 'Metal',
                'Mineral Processing': 'Mineral',
                'Nuclear Energy': 'Nuclear',
                'Petrochemical': 'Petrochem',
                'Renewable Energy': 'Ren',
                'Renewable Energy Geothermal': 'Geothermal',
                'Renewable Energy Hydro': 'Hydro',
                'Renewable Energy Marine': 'Marine',
                'Renewable Energy Solar': 'Solar',
                'Renewable Energy Wind': 'Wind',
                'Smart Grids': 'SmartG',
                'Solid Waste': 'SolWas',
                'Traditional Fossil Fuels': 'FF',
                'Wastewater': 'Wastewater'}


dict_subsector_shortnames = {}
for k in dict_subsector_shortnames_uppercase.keys():
    dict_subsector_shortnames[k] = dict_subsector_shortnames_uppercase[k]
    dict_subsector_shortnames[k.lower()] = dict_subsector_shortnames_uppercase[k]



dict_var_colors = {'Count_CleanCar_excl': ['Clean Car', pal[2]],
                'Count_ICE_excl': ['ICE', pal[5]],
                'Count_EffICE_excl': ['ICE Efficiency', pal[7]],
                'Count_CleanCar': ['Clean Car', pal[2]],
                'Count_ICE': ['ICE', pal[5]],
                'Count_EffICE': ['ICE Efficiency', pal[7]],
                'CountClean': ['Clean', pal[2]],
                'CountClean_excl': ['Clean', pal[2]],
                'CountDirty': ['Dirty', pal[-5]],
                'CountDirty_excl': ['Dirty', pal[-5]],
                'CountGrey': ['Grey', pal[-3]],
                'CountGrey_excl': ['Grey', pal[-3]],
                'Count_Bat': ['Batteries', pal[0]],
                'Count_Bat_excl': ['Batteries', pal[0]],
                'Count_Bat_excl_wH2': ['Batteries', pal[0]],
                'Count_BatTrans': ['Batteries (for Transport)', pal[0]],
                'Count_BatTrans_excl': ['Batteries (for Transport)', pal[0]],
                'Count_BatNotTr': ['Batteries (not for Transport)', pal[-1]],
                'Count_BatNotTr_excl': ['Batteries (not for Transport)', pal[-1]],
                'Count_FC': ['Fuel Cells', pal[3]],
                'Count_FC_excl': ['Fuel Cells', pal[3]],
                'Count_FC_excl_wH2': ['Fuel Cells', pal[3]],
                'Count_HV': ['Hybrid', pal[-3]],
                'Count_HV_excl': ['Hybrid', pal[-3]],
                'Count_H2': ['Hydrogen', pal[-1]],
                'Count_H2_excl': ['Hydrogen', pal[-1]],
                'Count_EV': ['Electric Vehicles', pal[2]],
                'Count_EV_excl': ['Electric Vehicles', pal[2]],
                'Count_Enab': ['Enabling', pal[-6]],
                'Count_Enab_excl': ['Enabling', pal[-6]],
                'Count_Stor': ['Storage', pal[1]],
                'Count_Stor_excl': ['Storage', pal[1]],
                'Count_Biofuels': ['Biofuels', pal[4]],
                'Count_Biofuels_excl': ['Biofuels', pal[4]],
                'Count_bothbatfc': ['Batteries & FC', pal[-4]],
                'Count_bothbatfc_wH2': ['Batteries & FC', pal[-4]],
                'Count_ICE_andEffICE_excl': ['ICE and ICE Efficiency', pal[7]],
                'Count_OtherCleanCar': ['Other Clean Car', pal[2]]
                   }


list_of_subsectors_in_cleancars = ['electric vehicles', 'fuel cells', 'energy storage', 'hybrid vehicles', 'hydrogen', 'batteries']



def main():
    return dict_subsector_shortnames, dict_var_colors, list_of_subsectors_in_cleancars


def get_dict_subsector_shortnames():
    return dict_subsector_shortnames

def get_dict_var_colors():
    return dict_var_colors


def get_list_of_subsectors_in_cleancars():
    return list_of_subsectors_in_cleancars

